﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Machine.Specifications;
using NUnit.Framework;
using Raven.Client;
using SportsStore.DataBaseInfrastructure;

namespace SportsStore.DatabaseInfraStructure.Test.DatabaseSessionCreation
{
    public class When_I_Ask_For_Session_With_The_DataStore_It_Should_Open_The_Connection
    {
        static IDocumentStore ravenDatabase;
        static IDocumentSession ravenSession;
         Establish context = () => 
         {
             ravenDatabase = new RavenDataBaseConnection(@"http://localhost:8080").Connect();
         };

        Because I_Need_Create_A_Session = () =>
        {
            ravenSession = new RavenSession(ravenDatabase).OpenSession();
        };

        It Should_Allow_Return_The_Session_Object = () =>
        {
            ravenSession.ShouldBeOfType<IDocumentSession>();
        };
    }
}
